import request from './request'

// 请求首页数据
export const getHomeList = () => request.get('/index/index')

// 获取搜索弹出框的数据
export const getSearchPopupData = () => request.get('/search/index')

// 获取实时搜索的文本提示的数据列表
export const getSearchTipsListData = (paramObj) => {
  return request.get('/search/helper', { params: paramObj })
}

// 获取搜索的商品列表数据
export const getGoodsListData = (paramObj) => {
  // console.log(paramObj)
  return request.get('/goods/list', { params: paramObj })
}

// 清除历史搜索记录
export const clearHistory = () => request.post('/search/clearhistory')

// 获取商品详情数据
export const getGoodsDetailData = (paramObj) => {
  // console.log(paramObj)
  return request.get('/goods/detail', { params: paramObj })
}
// export的导入时要加{},export default的导入时不用加
// 登陆请求
export const goLogin = (paramObj) => request.post('/auth/loginByWeb', paramObj)
// 获取购物车产品数量
export const getGoodsCount = () => request.get('/cart/goodscount')
// 加入购物车
export const addGoodsToCar = (paramObj) => request.post('/cart/add', paramObj)
// 获取购物车数据
export const getCartListData = () => request.get('/cart/index')
// 点击切换商品选中状态
export const changeGoodsChecked = (paramObj) => request.post('/cart/checked', paramObj)
// 改变步进器发请求
export const changeGoodsStepper = (paramObj) => request.post('/cart/update', paramObj)
// 删除商品请求
export const deleteGoods = (paramObj) => request.post('/cart/delete', paramObj)
// 全部分类接口数据
export const getAllCategory = () => request.get('/catalog/index')
// 获取当前分类的数据
export const getCurrentCategory = (paramObj) => request.get('/catalog/current', { params: paramObj })
// 获取专题数据
export const getTopicData = (paramObj) => request.get('/topic/list', { params: paramObj })
